class WashMachine:
    def __init__(self, brand, capacity):
        """
        初始化
        :param brand: 品牌
        :param capacity:  容量
        """
        self.brand = brand
        self.capacity = capacity
        # 是否关闭
        self.is_closed = False
        # 模式 0:未设定模式 1:轻揉模式 2:狂揉模式
        self.__mode = 0
        # 马达转速
        self.motor_speed = 0
        
    def open_door(self):
        self.is_closed = False
        print('打开洗衣机门')
        
    def close_door(self):
        self.is_closed = True
        print('关闭洗衣机门')   
        
    def set_mode(self, new_mode):
        """
        调节模式
        :param new_mode:
        :return:
        """
        if new_mode not in [1, 2]:
            print('设置模式错误')
        else:
            self.__mode = new_mode   
     
    def __set_motor_speed(self, speed):
        """
        设置马达的转速
        :param speed:  1000: 轻揉模式  2000:狂揉模式
        :return:
        """
        self.motor_speed = speed          
    def wash(self):
        if not self.is_closed:
            # 洗衣机门是否关闭 ,没有关闭  提示
            print('请关闭洗衣机门,哔哔哔哔...')
            return
        elif self.__mode == 0:
            print('请设置模式')
            return
        # 执行下面的操作
        print('放水...')
        print('放满了...')
        if self.__mode == 1:
            print('轻揉模式, 洗内衣')
            # 调节马达转速
            self.__set_motor_speed(1000)
            print('马达转速:{}'.format(self.motor_speed))
            print('开始洗...')
        elif self.__mode == 2:
            print('狂揉模式, 洗外套')
            # 调节马达抓霉素
            self.__set_motor_speed(2000)
            print('马达转速:{}'.format(self.motor_speed))
            print('开始洗...')

        print('洗完了')
        
machine = WashMachine('海尔', 10)
machine.open_door()
machine.close_door()
machine.set_mode(2)
machine.wash()        
        